import React from 'react'
import { Divider, Tag } from 'antd'
import { LwjTable } from "components";
import moment from 'moment';
import LwjTable2 from 'components/LwjTable/LwjTable';
import { LwjButton } from "components";

const List = ({
  onShowDetail,
  onShowAudit,
  ...tableProps
}) => {
  const columns = [
    // {
    //   title: '批次号',
    //   dataIndex: 'batchNumCustom',
    //   key: 'batchNumCustom',
    //   width: "8%"
    // },
    {
      title: '结算类型',
      dataIndex: 'settlementType',
      key: 'settlementType',
      width: "2%",
      render: (text, record, index) => (record.settlementType === "RECEIVABLE" ? <Tag color="#2db7f5">应收</Tag> : < Tag color="#87d068">应付</Tag >)
    }, {
      title: '结算金额(元)',
      dataIndex: 'settlementMoney',
      key: 'settlementMoney',
      align: "right",
      width: "5%",
      render: (text, record, index) => (record.settlementMoney.toFixed(2))
    }, {
      title: '创建人',
      dataIndex: 'creatorName',
      key: 'creatorName',
      align: "right",
      width: "5%",
      align: "center"
    }, {
      title: '创建时间',
      dataIndex: 'createTime',
      key: 'createTime',
      width: "5%",
      render: (text, record, index) => (moment(record.createTime).format("YYYY-MM-DD"))
    }, {
      title: '操作',
      key: 'handle',
      width: "5%",
      render: (text, record) => (
        <span>
          <LwjButton
            tooltip="查看"
            type="primary"
            shape="circle"
            size="small"
            icon="eye"
            onClick={() => onShowDetail(record)} />
        </span>
      )
    }
  ];
  return (
    <div>
      {/* <LwjTable {...tableProps} columns={columns} /> */}
      <LwjTable2
        {...tableProps}
        columns={columns}
      />
    </div>
  )
};

export default List
